﻿using Microsoft.EntityFrameworkCore;
using System.Reflection.Metadata;

namespace WcMatch.Models
{
    public partial class CompanyContext : DbContext
    {
        public CompanyContext()
        {

        }

        public CompanyContext(DbContextOptions<CompanyContext> options) : base(options) { }

        public virtual DbSet<Company>? Companies { get; set; } = null;

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8_general_ci").HasCharSet("utf8");

            modelBuilder.Entity<Company>(entity =>
            {
                entity.ToTable("T_User_Company");
                entity.Property(e => e.CompanyId)
                    .HasMaxLength(50)
                    .HasColumnName("CompanyId");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);

    }
}
